package cn.bgs.controller;

import cn.bgs.pojo.Announcement;
import cn.bgs.service.IAnnouncementService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("sHuodong")
@RestController
public class HuodongController {
    @Autowired
    private IAnnouncementService service;

    @RequestMapping("findAll")
    public List<Announcement> findAll(@Param("id") Integer id, @Param("biaoti") String biaoti,@Param("lei") String lei){
        return service.findAll(id,biaoti,lei);
    }
    @RequestMapping("delete")
    public Boolean deleteById(Integer id){
        return service.deleteById(id);
    }
    @RequestMapping("updateById")
    public Boolean updateById(@Param("id") Integer id,@Param("huod") String huod,@Param("textarea") String textarea,@Param("marketName") String marketName,@Param("qu")Integer qu){
        return service.updateById(id,huod,textarea,marketName,qu);
    }
    @RequestMapping("findById")
    private List<Announcement> findById(@Param("id")Integer id1, @Param("lei")String lei){
        return service.findById(id1,lei);
    }

}
